package com.order.mapper;

import com.github.pagehelper.Page;
import com.order.dto.ConsumerPageQueryDTO;
import com.order.dto.OrderPageQueryDTO;
import com.order.entity.OrderHistory;
import com.order.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface OrderMapper {

    @Select("select * from order_history where id = #{id}")
    OrderHistory getById(Long id);

    @Select("select * from order_history where user_id = #{userId}")
    List<OrderHistory> getByUserId(Long userId);

    Page<OrderHistory> pageQuery(OrderPageQueryDTO orderPageQueryDTO);


    void insert(OrderHistory orderHistory);

}
